package com.ruoyi.common.constant;

import com.ruoyi.common.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum JobEnum implements BaseEnum {

    NY(1, "农林牧渔水利生产人员"),
    JS(2, "教师"),
    YW(3, "医务工作者"),
    JSRY(4, "专业技术人员"),
    SC(5, "生产、运输设备操作人员及有关人员"),
    SY(6, "商业、服务业人员"),
    QY(7, "国家机关、事业单位、企业负责人"),
    GJ(8, "国家机关、事业单位、企业办事人员和有关人员"),
    JR(9, "军人"),
    MT(10, "媒体、文体类工作人员"),
    ZXXS(11, "在校学生"),
    WJY(12, "未就业"),
    JW(13, "家务"),
    QT(14, "其他"),
        ;

    private Integer code;
    private String desc;

    
    public JobEnum addMsg(String msg) {
        this.desc = msg + "行：" + this.desc;
        return this;
    }

    public static JobEnum getByCode(int code) {
        for (JobEnum codeEnum : JobEnum.values()) {
            if (codeEnum.getCode().intValue() == code) {
                return codeEnum;
            }
        }
        return null;
    }

    @Override
    public String getKey() {
        return String.valueOf(code);
    }
}
